package org.flint92.springboot.embedcontainer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;

/**
 * @author flint92
 */
@SpringBootApplication
public class EmbedContainerApplication {

    public static void main(String[] args) {
        SpringApplication.run(EmbedContainerApplication.class, args);
    }

    @Bean
    public WebServerFactoryCustomizer webServerFactoryCustomizer() {
        return (WebServerFactoryCustomizer<ConfigurableServletWebServerFactory>) factory -> {
            factory.setContextPath("/embed");
            factory.setPort(8888);
        };
    }

}
